package gui.funcionarios;

import gui.GerenciadorDeJanelas;

import java.awt.Dimension;
import java.io.File;

import javax.swing.JFileChooser;

import javax.swing.ImageIcon;
import javax.swing.WindowConstants;
import javax.swing.JFrame;


/**
* This code was edited or generated using CloudGarden's Jigloo
* SWT/Swing GUI Builder, which is free for non-commercial
* use. If Jigloo is being used commercially (ie, by a corporation,
* company or business for any purpose whatever) then you
* should purchase a license for each developer using Jigloo.
* Please visit www.cloudgarden.com for details.
* Use of Jigloo implies acceptance of these licensing terms.
* A COMMERCIAL LICENSE HAS NOT BEEN PURCHASED FOR
* THIS MACHINE, SO JIGLOO OR THIS CODE CANNOT BE USED
* LEGALLY FOR ANY CORPORATE OR COMMERCIAL PURPOSE.
*/
public class FotoPanel extends javax.swing.JPanel {
	private JFileChooser jFileChooser1;
	private File file;
	private String nomeDoArquivo;
	

	/**
	* Auto-generated main method to display this 
	* JPanel inside a new JFrame.
	*/

	
	public FotoPanel() {
		super();
		initGUI();
	}
	
	private void initGUI() {
		try {
			this.setPreferredSize(new java.awt.Dimension(616, 353));
			{
				jFileChooser1 = new JFileChooser();
				this.add(jFileChooser1);
				int result = jFileChooser1.showOpenDialog(null); 
				if(result == JFileChooser.CANCEL_OPTION){  
					GerenciadorDeJanelas.window.setContentPane(SelecionaFuncionario.alteraFuncionario);
					
				}   
				else{  
					file = jFileChooser1.getSelectedFile().getAbsoluteFile();
					nomeDoArquivo = jFileChooser1.getSelectedFile().getAbsolutePath();
					
				}  
				
				
			}
		} catch (Exception e) {
			e.printStackTrace();
		}
		
	}
	public String retornaCaminho(){
		return nomeDoArquivo;
	}

}
